--[[
-- Author:      feilong
-- DateTime:    2018-04-23 17:19:33
-- Description: 
	模拟客户端
	1加载proto
	2连接tcp
	3登录测试
--]]

local socket = require "skynet.socket"

---------------------------------------------------------
-- class
---------------------------------------------------------
local Service = class("Robot")

function Service:ctor(name)

    g.handler = new("bot.handler")
    g.manager = new("bot.manager")
    self:register()
end

function Service:register()
    g.dispatch:register('start', handler(self, self.onStart))
    g.dispatch:register('close', handler(self, self.onClose))

end

function Service:onStart()
    g.handler:onStart()
    g.manager:onStart()

    return true
end

function Service:onClose()
    g.closed = true
    --把所有机器人退出桌子
    return true
end




return Service
